Skip to content

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 12, 2025

These benchmarks have an assumption that the container size is divisible by 4 because of how we populate their content, which wasn't satisfied.

These benchmarks have an assumption that the container size is
divisible by 4 because of how we populate their content, which
wasn't satisfied.
@ldionne ldionne requested a review from a team as a code owner September 12, 2025 12:56
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 12, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 12, 2025

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

These benchmarks have an assumption that the container size is divisible by 4 because of how we populate their content, which wasn't satisfied.


Full diff: https://github.com/llvm/llvm-project/pull/158287.diff

2 Files Affected:

  • (modified) libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp (+2-2)
  • (modified) libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp (+2-1)
diff --git a/libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp
index c0aee942eef64..e3ac50187ef4b 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp
@@ -76,7 +76,7 @@ int main(int argc, char** argv) {
             }
           })
           ->Arg(32)
-          ->Arg(50) // non power-of-two
+          ->Arg(52) // non power-of-two
           ->Arg(1024)
           ->Arg(8192);
     };
@@ -143,7 +143,7 @@ int main(int argc, char** argv) {
             }
           })
           ->Arg(32)
-          ->Arg(50) // non power-of-two
+          ->Arg(52) // non power-of-two
           ->Arg(1024)
           ->Arg(8192);
     };
diff --git a/libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp
index 45b52dd23b695..1885b53e51413 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp
@@ -61,6 +61,7 @@ int main(int argc, char** argv) {
             }
           })
           ->Arg(32)
+          ->Arg(52) // non power-of-two
           ->Arg(1024)
           ->Arg(8192);
     };
@@ -115,7 +116,7 @@ int main(int argc, char** argv) {
             }
           })
           ->Arg(32)
-          ->Arg(50) // non power-of-two
+          ->Arg(52) // non power-of-two
           ->Arg(1024)
           ->Arg(8192);
     };

@ldionne ldionne changed the title [libc++] Fix broke unique and unique_copy benchmarks [libc++] Fix broken unique and unique_copy benchmarks Sep 12, 2025
@ldionne
Copy link
Member Author

ldionne commented Sep 12, 2025

/libcxx-bot benchmark libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp

Benchmark results:

@ldionne ldionne merged commit 7943513 into llvm:main Sep 15, 2025
76 of 80 checks passed
@ldionne ldionne deleted the review/fix-broken-unique-benchmark branch September 15, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants